//: Playground - noun: a place where people can play

import UIKit
// command + 1

// 1.每句结束后不要;
// 2.打印使用print
// 3.调用方法和访问属性都是用.来进行
// 4.[[类名 alloc] init]] -> 类名()
// 5.[[类名 alloc] initWithXXX:]] -> 类名(XXX:)
// 6.[类名 类名WithXXX:] -> 类名(XXX:)
// 7.[类名 方法名称] -> 类名.方法名称()

var str = "Hello, playground"

print("hello")
// [[UIView alloc] initWithFrame: CGRectMake(0, 0, 100, 100)];
let view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))

// 设置背景颜色
view.backgroundColor = UIColor.redColor()
 // [[UIButton alloc] init]
let button1 = UIButton()

// 按钮
let button2 = UIButton(type: UIButtonType.ContactAdd)

button2.center = CGPoint(x: 50,y: 50)
view.addSubview(button2)

